<div id="main_content">
    <h3><?php echo $title; ?></h3>
    <a href="<?php echo base_url(); ?>conversion" class="btn addEmoloyeeBack m10"><?php echo $this->lang->line('CR_Back'); ?></a>
    <div class="form_add">    
        <form action="" method="post">
           <table border="0" class="add_data">
                    <tr>
                    <td align="right">
                       <label><?php echo $this->lang->line('CR_Usd'); ?> <font color="#FF0000">(*)</font></label>
                    </td>
                    <td>
                        <input type="text" name="txtRate" size="20" value="<?php echo set_value('txtRate'); ?>" maxlength="5" />&nbsp;&nbsp;<?php $this->lang->line('CR_Vnd');?> 
                        <span class="error"><?php echo form_error('txtRate'); ?></span>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <label><?php echo $this->lang->line('CR_Applydate'); ?> <font color="#FF0000">(*)</font> </label>
                    </td>
                    <td>
                        <input type="text" name="txtApplyDate" maxlength="10" size="20" class="datepicker" value="<?php echo set_value('txtApplyDate'); ?>" /> <?php echo $this->lang->line('LR_DateFormat');?> 
                        <span class="error"><?php echo form_error('txtApplyDate'); ?></span>
                    </td>
                </tr>               
                <tr>           
                    <td align="left" colspan="2">
                            <input type="submit" name="btnSubmit" value="<?php echo $this->lang->line('CR_Submit'); ?>" />
                    </td>
                </tr>                                                                                         
           </table> 
        </form>
    </div>
</div>
<!-- BEGIN dialog message -->
<div id="dialog" title="<?php echo $this->lang->line('CR_dialog_title'); ?>">
    <?php echo isset($message) ? $message : ''; ?>
</div>
<!-- END dialog message -->
<script type="text/javascript">
    $(document).ready(function() {
        $(function() {
            $(".datepicker").datepicker({
                dateFormat: 'yy/mm/dd',
                showOn: "button",
                buttonImage: "<?php echo base_url(); ?>/public/sites/images/calendaricon.gif",
                buttonImageOnly: true,
                changeMonth: true,
                changeYear: true,
            });
        });
<?php if (isset($flag) && $flag == TRUE): ?>
            $(function() {
                $("#dialog").dialog({
                    modal: true,
                    close: function() {
                        window.location.href = '<?php echo base_url('/conversion'); ?>';
                    },
                    buttons: [{
                        text: "<?php echo $this->lang->line('MC019');?>",
                        click: function() {
                            window.location.href = '<?php echo base_url('/conversion'); ?>';
                        },
                    }]
                });
            });
<?php elseif (isset($flag) && $flag == FALSE): ?>
            $(function() {
                $("#dialog").dialog({
                buttons: [
                    { text: "<?php echo $this->lang->line('MC019');?>", click: function() { $( this ).dialog( "close" ); } }
                ]
                });
            });
<?php endif; ?>
    });
</script>